home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-03-20 | 864 b | 34 lines | [TEXT/BROW] |
-
- #include "CSoundAttachment.h"
- #include "USoundPlayer.h"
-
- #include <string.h>
-
- // use with an entry in FinishCreateSelf, such as:
- // mOpenFilingButton->AddAttachment(new CSoundAttachment("Click", msg_Click));
-
- // ===========================================================================
- // • CSoundAttachment CSoundAttachment •
- // ===========================================================================
- // Plays sound when executed
- // Suitable for use with any message
-
- CSoundAttachment::CSoundAttachment(
- const char* inSoundName,
- MessageT inMessage,
- Boolean inExecuteHost)
- : LAttachment(inMessage, inExecuteHost)
- {
- mSoundName[0] = strlen(inSoundName);
- memcpy(&mSoundName[1], inSoundName, mSoundName[0]);
- }
-
-
- void
- CSoundAttachment::ExecuteSelf(
- MessageT /* inMessage */,
- void* /* ioParam */)
- {
- USoundPlayer::PlaySound(mSoundName);
- }
-